#ifndef ACTIONQUEUE_H
#define ACTIONQUEUE_H

#pragma once

#include <QThread>
#include "ActionItem.h"

class CActionQueue : public QThread
{
	Q_OBJECT

public:
	CActionQueue(QObject *parent);
	~CActionQueue();
	void Enqueue(IActionItem *item, bool highPriority = false);

public slots:
	void Shutdown();

protected:
	void run();

private:
	IActionItem* Dequeue();
	QList<IActionItem*> m_queue;
	QMutex m_lock;
	QWaitCondition m_queueNotEmpty;
	volatile bool m_running;
	
};

#endif // ACTIONQUEUE_H
